home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
easyblt
/
bltsysmo.bas
< prev
next >
Wrap
BASIC Source File
|
1999-04-24
|
2KB
|
64 lines
Attribute VB_Name = "BltSysMod"
Public Type SysClpBrd
DC As Long
BMP As Long
Empty As Boolean
Width As Integer
Height As Integer
End Type
Public OldBMP As Long
Public ClpBoard As SysClpBrd
Public Sub CreateClpBrd(Hwnd As Long)
ClpBoard.DC = CreateCompatibleDC(GetDC(Hwnd))
ClpBoard.BMP = CreateCompatibleBitmap(GetDC(Hwnd), 800, 600)
ClpBoard.Empty = True
End Sub
Public Function CopyPicture(DC As Long, X As Integer, y As Integer, H As Integer, W As Integer) As Boolean
OldBMP = SelectObject(ClpBoard.DC, ClpBoard.BMP)
ret1% = BitBlt(ClpBoard.DC, X, y, W, H, DC, X, y, SRCCOPY)
ret& = SelectObject(ClpBoard.DC, OldBMP)
ClpBoard.Empty = False
ClpBoard.Height = H
ClpBoard.Width = W
CopyPicture = ret1%
End Function
Public Function PastePicture(DC As Long, X As Integer, y As Integer) As Boolean
If ClpBoard.Empty = True Then
PastePicture = False
Exit Function
End If
OldBMP = SelectObject(ClpBoard.DC, ClpBoard.BMP)
ret1% = BitBlt(DC, X, y, ClpBoard.Width, ClpBoard.Height, ClpBoard.DC, X, y, SRCCOPY)
ret& = SelectObject(ClpBoard.DC, OldBMP)
PastePicture = ret1%
End Function
Public Sub ClearClpBoard()
ret% = DeleteObject(ClpBoard.BMP)
ClpBoard.BMP = CreateCompatibleBitmap(0&, 800, 600)
ClpBoard.Empty = True
End Sub
Public Sub DestroyClpBrd()
ret% = DeleteDC(ClpBoard.DC)
ret% = DeleteObject(ClpBoard.BMP)
End Sub
Public Sub DirectBltCopy(SrcDC As Long, srcBMP As Long, tarDC As Long, tarBMP As Long, W As Integer, H As Integer)
OldBMP = SelectObject(SrcDC, srcBMP)
ret% = BitBlt(tarDC, 0, 0, W, H, SrcDC, 0, 0, SRCCOPY)
OldBMP = SelectObject(SrcDC, OldBMP)
End Sub
Public Sub DirectStretchCopy(SrcDC As Long, srcBMP As Long, tarDC As Long, tarBMP As Long, OW As Integer, OH As Integer, W As Integer, H As Integer)
OldBMP = SelectObject(SrcDC, srcBMP)
ret% = StretchBlt(tarDC, 0, 0, W, H, SrcDC, 0, 0, OW, OH, SRCCOPY)
OldBMP = SelectObject(SrcDC, OldBMP)
End Sub